<?PHP
  class PageDeletePage extends Editor{
    function __construct($page){
      $this->page = $page;
    }
  
    public function display(){
      $page = new Page();
      $page->loadProperties($GLOBALS['db']->EscapeString($_GET['site']));
     
      $host = Settings::getInstance()->get("host");

      if(!$_GET['delete']){
        $template = new Template();
        $template->load("site_delete");
        $template->assign_var("TITLE", $page->title);
        $template->assign_var("SITESURL", $host."admin/home.html");
        $template->assign_var("DELETEURL", $host."admin/pagedelete.html?site=".urlencode($_GET['site'])."&delete=true");
        $template->output();
      }
      else{
        if($page->delete()){
          $template = new Template();
	      $template->load("message");
          $template->assign_var("MESSAGE","Die Seite <strong>". $page->title."</strong> wurde gel&ouml;scht!");
          $template->output();
        }
      }
    }

    function getHeader(){
    }
    
    public function getEditableCode(){
      return "<input name=\"save\" type=\"submit\" value=\"&Auml;ndern\" onclick=\"form.action='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."' ; target='_self' ; return true\" />";
    }
    
    public function save($newPage,$oldPage){
    }

    public function displayBreadcrumb($separator,$class,$idpraefix){
      FolderBreadcrumb::display($this->page,$separator,$class,$idpraefix);
    }
}
?>